from Lexer import Lexer

if __name__ == "__main__":
    a = Lexer()
    nd1 = a.addNode()
    nd2 = a.addNode()
    nd3 = a.addNode()
    a.linkNode(nd1, nd2, {'<'})
    a.linkNode(nd2, nd2, set("abcdefghijklmnopqrstuvwxyz")).monitor()
    a.linkNode(nd2, nd3, {'>'})
    print(a.edgeList[1].monitorId)
    a.setStart(nd1)
    a.setEnd(nd3)
    # a.debug()
    print(len(a.edgeList))
    while True:
        print(a.go(input()))
        print(a.monitorList)